<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>node|基于node的爬虫服务 | 一只咸鱼 | 努力学习最新姿势！！！</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="Node">
    <meta name="description" content="前言爬取丁香园的数据并提供api,为界面可视化提供接口服务。 安装1234安装nodejs查看版本npm -v新建api项目 执行npm init 初始化package.json添加依赖包 执行npm install express body-parser mysql cors request --save  添加配置新建index.js  1234567891011121314151617181">
<meta property="og:type" content="article">
<meta property="og:title" content="node|基于node的爬虫服务">
<meta property="og:url" content="http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/index.html">
<meta property="og:site_name" content="一只咸鱼">
<meta property="og:description" content="前言爬取丁香园的数据并提供api,为界面可视化提供接口服务。 安装1234安装nodejs查看版本npm -v新建api项目 执行npm init 初始化package.json添加依赖包 执行npm install express body-parser mysql cors request --save  添加配置新建index.js  1234567891011121314151617181">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200217220913254.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70">
<meta property="article:published_time" content="2020-04-06T09:03:00.000Z">
<meta property="article:modified_time" content="2020-04-07T07:47:45.006Z">
<meta property="article:author" content="Mr.Zhang">
<meta property="article:tag" content="Node">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20200217220913254.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70">
    
        <link rel="alternate" type="application/atom+xml" title="一只咸鱼" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

<meta name="generator" content="Hexo 4.2.0"></head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Mr.Zhang</h5>
          <a href="mailto:zhangticcc@163.com" title="zhangticcc@163.com" class="mail">zhangticcc@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                首页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                时间轴
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://weibo.com/u/5392412243" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/zhangti0708" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                开源地址
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://blog.csdn.net/weixin_40902527" target="_blank" >
                <i class="icon icon-lg icon-rss"></i>
                技术博客
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://zhangticcc.gitee.io/webgis/" target="_blank" >
                <i class="icon icon-lg icon-globe"></i>
                GIS案例
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://mp.weixin.qq.com/s/p4TOhKcr4RZkZWzuMYyBEQ" target="_blank" >
                <i class="icon icon-lg icon-weixin"></i>
                微信订阅号
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">node|基于node的爬虫服务</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">node|基于node的爬虫服务</h1>
        <h5 class="subtitle">
            
                <time datetime="2020-04-06T09:03:00.000Z" itemprop="datePublished" class="page-time">
  2020-04-06
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E5%90%8E%E5%8F%B0/">后台</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#前言"><span class="post-toc-number">1.</span> <span class="post-toc-text">前言</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#安装"><span class="post-toc-number">2.</span> <span class="post-toc-text">安装</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#添加配置"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">添加配置</span></a></li></ol></li></ol>
        </nav>
    </aside>


<article id="post-node-基于node的云函数爬虫"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">node|基于node的爬虫服务</h1>
        <div class="post-meta">
            <time class="post-time" title="2020-04-06 17:03:00" datetime="2020-04-06T09:03:00.000Z"  itemprop="datePublished">2020-04-06</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E5%90%8E%E5%8F%B0/">后台</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>爬取丁香园的数据并提供api,为界面可视化提供接口服务。</p>
<h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">安装nodejs</span><br><span class="line">查看版本npm -v</span><br><span class="line">新建api项目 执行npm init 初始化package.json</span><br><span class="line">添加依赖包 执行npm install express body-parser mysql cors request --save</span><br></pre></td></tr></table></figure>

<h4 id="添加配置"><a href="#添加配置" class="headerlink" title="添加配置"></a>添加配置</h4><p>新建index.js </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;* 引入express框架 *&#x2F;</span><br><span class="line">const express &#x3D; require(&#39;express&#39;);</span><br><span class="line">const app &#x3D; express();</span><br><span class="line"> </span><br><span class="line">&#x2F;* 引入cors *&#x2F;</span><br><span class="line">const cors &#x3D; require(&#39;cors&#39;);</span><br><span class="line">app.use(cors());</span><br><span class="line"> </span><br><span class="line">&#x2F;* 引入body-parser *&#x2F;</span><br><span class="line">const bodyParser &#x3D; require(&#39;body-parser&#39;);</span><br><span class="line">app.use(bodyParser.json());</span><br><span class="line">app.use(bodyParser.urlencoded(&#123; extended: false &#125;));</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">&#x2F;* 引入mysql </span><br><span class="line">const mysql &#x3D; require(&#39;mysql&#39;);</span><br><span class="line">const conn &#x3D; mysql.createConnection(&#123;</span><br><span class="line">    host: &#39;localhost&#39;,</span><br><span class="line">    user: &#39;root&#39;,</span><br><span class="line">    password: &#39;123456&#39;,</span><br><span class="line">    database: &#39;test&#39;,</span><br><span class="line">    multipleStatements: true</span><br><span class="line">&#125;)</span><br><span class="line">*&#x2F;</span><br><span class="line"> </span><br><span class="line">const ncov &#x3D; require(&#39;.&#x2F;getDxyData&#39;)</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">&#x2F;* 监听端口 *&#x2F;</span><br><span class="line">app.listen(8585, () &#x3D;&gt; &#123;</span><br><span class="line">    console.log(&#39;——————————服务已启动——————————&#39;);</span><br><span class="line">&#125;)</span><br><span class="line"> </span><br><span class="line">app.get(&#39;&#x2F;&#39;, (req, res) &#x3D;&gt; &#123;</span><br><span class="line">    res.send(&#39;&lt;p style&#x3D;&quot;color:red&quot;&gt;服务已启动&lt;&#x2F;p&gt;&#39;);</span><br><span class="line">&#125;)</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">app.get(&#39;&#x2F;api&#x2F;getNcovData&#39;, (req, res) &#x3D;&gt; &#123;</span><br><span class="line">  ncov.main_handler((data)&#x3D;&gt;&#123;</span><br><span class="line">    res.json(data)</span><br><span class="line">  &#125;)</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>

<p>引入函数文件 getDxyData.js 爬取丁香园数据</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br></pre></td><td class="code"><pre><span class="line">const request &#x3D; require(&#39;request&#39;)</span><br><span class="line">&#x2F;&#x2F;获取丁香园疫情数据</span><br><span class="line">async function getDxyData() &#123;</span><br><span class="line">  try &#123;</span><br><span class="line">    const body &#x3D; await new Promise(</span><br><span class="line">      (resolve, reject) &#x3D;&gt; &#123;</span><br><span class="line">        request(&#123;</span><br><span class="line">          method: &#39;GET&#39;,</span><br><span class="line">          uri: &#39;https:&#x2F;&#x2F;ncov.dxy.cn&#x2F;ncovh5&#x2F;view&#x2F;pneumonia&#39;</span><br><span class="line">        &#125;, (error, response, body) &#x3D;&gt; &#123;</span><br><span class="line">          if (error) return reject(error)</span><br><span class="line">          resolve(body)</span><br><span class="line">        &#125;)</span><br><span class="line">      &#125;</span><br><span class="line">    )</span><br><span class="line">    const statistics &#x3D; JSON.parse(&#x2F;getStatisticsService\s*&#x3D;\s*(.*?)&#125;catch&#x2F;.exec(body)[1])</span><br><span class="line">    const timeline &#x3D; JSON.parse(&#x2F;getTimelineService\s*&#x3D;\s*(.*?)&#125;catch&#x2F;.exec(body)[1])</span><br><span class="line"> </span><br><span class="line">    const areaStatistics &#x3D; JSON.parse(&#x2F;getAreaStat\s*&#x3D;\s*(.*?)&#125;catch&#x2F;.exec(body)[1])</span><br><span class="line">    let listByArea &#x3D; areaStatistics.map((x) &#x3D;&gt; &#123;</span><br><span class="line">      return &#123;</span><br><span class="line">        provinceName: x.provinceName,</span><br><span class="line">        provinceShortName: x.provinceShortName,</span><br><span class="line">        tags: x.tags,</span><br><span class="line">        confirmed: x.confirmedCount,</span><br><span class="line">        suspected: x.suspectedCount,</span><br><span class="line">        cured: x.curedCount,</span><br><span class="line">        dead: x.deadCount,</span><br><span class="line">        comment: x.comment,</span><br><span class="line">        cities: x.cities.map((x) &#x3D;&gt; &#123;</span><br><span class="line">          return &#123;</span><br><span class="line">            cityName: x.cityName,</span><br><span class="line">            confirmed: x.confirmedCount,</span><br><span class="line">            suspected: x.suspectedCount,</span><br><span class="line">            cured: x.curedCount,</span><br><span class="line">            dead: x.deadCount</span><br><span class="line">          &#125;</span><br><span class="line">        &#125;)</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;)</span><br><span class="line"> </span><br><span class="line">    let listByOther &#x3D; JSON.parse(&#x2F;getListByCountryTypeService1\s*&#x3D;\s*(.*?)&#125;catch&#x2F;.exec(body)[1])</span><br><span class="line">    listByOther &#x3D; listByOther.map((x) &#x3D;&gt; &#123;</span><br><span class="line">      return &#123;</span><br><span class="line">        provinceId: x.provinceId,</span><br><span class="line">        provinceName: x.provinceName,</span><br><span class="line">        provinceShortName: x.provinceShortName,</span><br><span class="line">        tags: x.tags,</span><br><span class="line">        confirmed: x.confirmedCount,</span><br><span class="line">        suspected: x.suspectedCount,</span><br><span class="line">        cured: x.curedCount,</span><br><span class="line">        dead: x.deadCount,</span><br><span class="line">        comment: x.comment,</span><br><span class="line">        createTime: x.createTime,</span><br><span class="line">        modifyTime: x.modifyTime,</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;)</span><br><span class="line"> </span><br><span class="line">    return &#123;</span><br><span class="line">      readme: &#123;</span><br><span class="line">        source: &#39;https:&#x2F;&#x2F;ncov.dxy.cn&#x2F;ncovh5&#x2F;view&#x2F;pneumonia&#39;,</span><br><span class="line">        statistics: &#39;数据概要&#39;,</span><br><span class="line">        listByArea: &#39;国内数据&#39;,</span><br><span class="line">        listByOther: &#39;国外数据&#39;,</span><br><span class="line">        timeline: &#39;实时播报&#39;</span><br><span class="line">      &#125;,</span><br><span class="line">      statistics,</span><br><span class="line">      listByArea,</span><br><span class="line">      listByOther,</span><br><span class="line">      timeline</span><br><span class="line">    &#125;</span><br><span class="line">  &#125; catch (err) &#123;</span><br><span class="line">    return null</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"> </span><br><span class="line">exports.main_handler &#x3D; async (callback) &#x3D;&gt; &#123;</span><br><span class="line">  const data &#x3D; await getDxyData()</span><br><span class="line">  if (!data)callback(&#123; error: 1, message: &#39;加载失败，刷新再试&#39; &#125;)</span><br><span class="line">  callback(&#123; error: 0, message: &#39;数据获取成功&#39;,data:data &#125;)</span><br><span class="line">  </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>执行命令</p>
<figure class="highlight plain"><figcaption><span>index.js ```</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">打开页面访问 : &#96;&#96;&#96;http:&#x2F;&#x2F;localhost:8585&#x2F;api&#x2F;getNcovData</span><br></pre></td></tr></table></figure>

<img alt="" height="597" src="https://img-blog.csdnimg.cn/20200217220913254.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MDkwMjUyNw==,size_16,color_FFFFFF,t_70" width="1111">
        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-04-07T07:47:45.006Z" itemprop="dateUpdated">2020-04-07 15:47:45</time>
</span><br>


        
        这里可以写作者留言，标签和 hexo 中所有变量及辅助函数等均可调用，示例：<a href="/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/" target="_blank" rel="external">http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/</a>
        
    </div>
    
    <footer>
        <a href="http://yoursite.com">
            <img src="/img/avatar.jpg" alt="Mr.Zhang">
            Mr.Zhang
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Node/" rel="tag">Node</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/&title=《node|基于node的爬虫服务》 — 一只咸鱼&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/&title=《node|基于node的爬虫服务》 — 一只咸鱼&source=分享各种福利和姿势..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《node|基于node的爬虫服务》 — 一只咸鱼&url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2020/04/06/Es6-%E5%AF%BC%E5%85%A5%E5%AF%BC%E5%87%BA%E5%92%8C%E7%BC%96%E8%AF%91es5/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">Es6 | 异步,导出导入,编译es5详解</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2020/04/06/python-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%B9%8B%E9%9A%8F%E6%9C%BA%E6%A3%AE%E6%9E%97%E7%AE%97%E6%B3%95/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">python|机器学习之随机森林算法</h4>
      </a>
    </div>
  
</nav>



    




















</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/img/wechat.jpg" data-alipay="/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>Mr.Zhang &copy; 2015 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/&title=《node|基于node的爬虫服务》 — 一只咸鱼&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/&title=《node|基于node的爬虫服务》 — 一只咸鱼&source=分享各种福利和姿势..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《node|基于node的爬虫服务》 — 一只咸鱼&url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=http://yoursite.com/2020/04/06/node-%E5%9F%BA%E4%BA%8Enode%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E7%88%AC%E8%99%AB/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
